package View;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import model.HelperHtml;

/**
 * Servlet implementation class Booking
 */
@WebServlet("/Booking")
public class Booking extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Booking() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		response.setCharacterEncoding("utf-8");
		String ID=request.getParameter("MaTour");
		response.getWriter().write(HelperHtml.getHtml(LoadData(ID)));
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}
	private String LoadData(String ID) {
		String s="";
		s+=
		"<h3>Thông tin liên lạc: </h3>"+
		"<form action=\"\">"+
		"<table width=\"100%\" cellpadding=\"2\" border=\"0\">"+
			"<tbody>"+
				"<tr>"+
					"<td width=\"15%\" valign=\"top\"><span > Họ và tên </span></td>"+
					"<td valign=\"top\" colspan=\"3\"><input id=\"fullname\" style=\"width: 300px;\""+
					"type=\"text\" name=\"fullname\" value=\"\"></input>"+
					"</td>"+
				"</tr>"+
				"<tr>"+
					"<td valign=\"top\"><span > Email </span></td>"+
					"<td valign=\"top\" colspan=\"3\"><input id=\"email\" style=\"width: 300px;\""+
					"type=\"text\" name=\"fullname\" value=\"\"></input>"+
					"</td>"+
				"</tr>"+
				"<tr>"+
					"<td valign=\"top\"><span > Điện thoại </span></td>"+
					"<td valign=\"top\" colspan=\"3\"><input id=\"phonenumber\" style=\"width: 150px;\""+
					"type=\"text\" name=\"fullname\" value=\"\"></input>"+
					"</td>"+
				"</tr>"+
				"<tr>"+
					"<td valign=\"top\"><span > Số lượng </span></td>"+
					"<td valign=\"top\" colspan=\"3\"><input id=\"number\" style=\"width: 150px;\""+
					"type=\"text\" name=\"fullname\" value=\"\"></input>"+
					"</td>"+
				"</tr>"+
			"</tbody>"+
		"</table>"+
		"</form>";
		return s;
	}

}
